<template>
<Tooltip v-bind="$attrs" v-on="$listeners" v-if="tip">
    <svg aria-hidden="true" :class="className" :style="'font-size: ' + size + 'px;'">
        <use :xlink:href="'#icon-' + href"></use>
    </svg>
</Tooltip>
<svg aria-hidden="true" :class="className" :style="'font-size: ' + size + 'px;'" v-else>
    <use :xlink:href="'#icon-' + href"></use>
</svg>
</template>

<script>
export default {
    props: {
        href: String,
        "class-name": {
            type: String,
            default: "icon"
        },
        tip: {
            type: Boolean,
            default: false
        },
        size: {
            type: Number,
            default: 14
        }
    },
    data() {
        return {

        }
    },
    mounted() {
    },
}
</script>

<style lang="less" scoped>
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.25em;
    fill: currentColor;
    overflow: hidden;
}
</style>
